import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { store, key } from './store'
import register from './components/jt-global-register'
import i18n from './i18n'
import { createPinia } from 'pinia'
// global css
import './assets/styles/index.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import {registerEcharts} from "@/plugins/echarts"
// cesium vue
import { mockXHR } from "@/mock/index";

import cesiumVue from './libs/cesium/cesium-vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// const  currentEnv=import.meta.env.VITE_APP_ENV;
// if(currentEnv==='production'){
//   window.DIGITALFARMLANDURL=''
// }
(window as any).resourceBaseUrl='https://coderfmc.github.io/three.js-demo/digital-farmland'
registerEcharts(app)
app.use(store, key).use(router).use(cesiumVue).use(i18n)
app.use(createPinia())
register(app)
app.use(ElementPlus)
app.mount('#app')
// mockXHR()
